﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace WindowsGame1
{
    class Tempo
    {
        public TimeSpan Total, tempoRestante;
        public int Ptos, mortes, highscore, wins;
        public int globHighscore;
        public string globNome;
        public string nome;
        public Tempo()
        {
            Total = TimeSpan.Zero;
            tempoRestante = TimeSpan.FromSeconds(10);
            Ptos = 0;
            mortes = 0;
            highscore = 0;
            wins = 0;
            //nome = "xpto";
        }

        public void ContaTempo(GameTime gameTime)
        {
            Total += gameTime.ElapsedGameTime;
            tempoRestante -= gameTime.ElapsedGameTime;
        }

        public void ContaRest(GameTime gameTime)
        {
            tempoRestante -= gameTime.ElapsedGameTime;
        }

        public void AdicionaPontos(GameTime gameTime)
        {
            int seconds = (int)Math.Round(gameTime.ElapsedGameTime.TotalSeconds * 100.0f);
            Ptos += seconds;
        }

        public void ConverteTempo()
        {
            int seconds = (int)Math.Round(tempoRestante.TotalSeconds * 100.0f);
            Ptos += seconds;
        }
        public void ResetaTempo()
        {
            tempoRestante = TimeSpan.FromSeconds(10);
        }
    }
}
